package com.example.JavaConcurrent.Project2_CountDownLatchAndCyclicBarrier.CyclicBarrierBegin_8;

public class Run {
    public static void main(String[] args) throws InterruptedException {


        MyService myService=new MyService();

        MyThread t1  = new MyThread(myService);
        t1.setName("t1");

        MyThread t2  = new MyThread(myService);
        t2.setName("t2");

        MyThread t3  = new MyThread(myService);
        t3.setName("t3");

        t1.start();
        t2.start();
//        t3.start();



        Thread.sleep(2000);

        myService.cbRef.reset();//重置屏障，等待的2个线程异常

    }
}
